<template>
	<view>
		<view style="background-color: #EC5C53;height: 80upx;line-height: 80upx;text-align: center;font-size: 34upx;color: #fff;">
			当前总积分: {{credit1}}
		</view>
		
		<view v-for="(item,index) in res" :key="index" style="padding: 0 20upx;background-color: #FFFFFF;border-radius: 20upx;margin-top: 5upx;border-bottom: 2upx solid #eeeeee;position: relative;box-shadow: 2upx 2upx 10upx #CCCCCC;margin-top: 15upx;" >
			<view style="padding: 0 20upx;">
				
				
				<view style="height: 80upx;line-height: 80upx;font-size: 32upx;display: flex;">
					<view style="text-align: left;flex: 1;height: 80upx;line-height: 80upx;">积分变动</view>
					<view style="text-align: right;flex: 1;height: 80upx;line-height: 80upx;color: #FF3333;">{{item.num}}</view>
				</view>
				
				<view style="height: 80upx;line-height: 80upx;font-size: 32upx;display: flex;">
					<view style="text-align: left;flex: 1;height: 80upx;line-height: 80upx;">支付时间</view>
					<view style="text-align: right;flex: 1;height: 80upx;line-height: 80upx;">{{item.createtime}}</view>
				</view>
				
				<view style="min-height: 80upx;line-height: 80upx;font-size: 32upx;">
					<view style="text-align: left;height: 80upx;line-height: 80upx;">备注 :</view>
					<view style="text-align: left;min-height: 80upx;line-height: 80upx;word-break: break-word;word-break: break-all;">{{item.remark}}</view>
				</view>
				
				<!-- <view style="min-height: 80upx;line-height: 80upx;color: #ff5500;" v-if="item.remark != ''">
					<text style="color: #ccc;">驳回理由</text>
					<text style="padding-left: 40upx;">{{item.remark}}</text>
				</view> -->
			</view>
			
		</view>
		<!-- <uni-load-more :loadingType="loadingType" :contentText="contentText"></uni-load-more> -->
	</view>
</template>

<script>
	export default {
		data() {
			return {
				res:[],
				openid:'',
				credit1:'',
			}
		},
		onLoad() {
			uni.getStorage({
				key: 'openid',
				success: (res) => {
					this.openid = res.data
					this.setAjax()
				},
				fail: () => {
					uni.navigateTo({
						url: '../../../login/login'
					});
				}
			});
		},
		methods: {
			setAjax(){
				uni.request({
					url: 'https://app.t9y9y9.com/app/index.php?i=4&c=entry&m=ewei_shopv2&do=mobile&r=member.fuxiao&app=1',
					method: 'POST',
					data: {
						'openid':this.openid,
						},
					header:{'Content-Type':'application/x-www-form-urlencoded'},
					success: res => {
						console.log(res)
						this.res = res.data.fuxiao
						this.credit1 = res.data.zfuxiao
					},
					fail: () => {},
					complete: () => {}
				});
			},
		}
	}
</script>

<style>

</style>
